package com.mezz.bones.framework.base.exception;

import com.mezz.bones.framework.base.domain.enums.ResponseCode;
import lombok.Getter;

@Getter
public class BaseException extends RuntimeException{


    private static final long serialVersionUID = 1223536604890537333L;
    private String code;
    private String msg;

    public BaseException(String msg) {
        super(msg);
        this.code = ResponseCode.SYS_ERROR.getCode();
        this.msg = msg;
    }

    public BaseException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BaseException(ResponseCode responseCode, String msg) {
        super(msg);
        this.code = responseCode.getCode();
        this.msg = msg;
    }

    public BaseException(ResponseCode responseCode) {
        super(responseCode.getMessage());
        this.code = responseCode.getCode();
        this.msg = responseCode.getMessage();
    }
}
